package com.crm.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "parts")
public class Parts implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public String toString() {
		return "Parts [partid=" + partid + ", description=" + description
				+ ", prtnum=" + prtnum + ", qty=" + qty + ", enqid=" + enqid
				+ ", application=" + application + ", make=" + make
				+ ", specification=" + specification + ", businessId="
				+ businessId + "]";
	}


	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")

	private Integer partid;
	private String description;

	private String prtnum;

	private int qty;
	
	
	
	//@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="enqid")
	private int enqid;

	private String application;

	private String make;
	
	private String specification;
	
	
	@ManyToOne
	@JoinColumn(name="BUSINESS_ID")
	private Business businessId;

	public Business getBusinessId() {
		return businessId;
	}


	public void setBusinessId(Business businessId) {
		this.businessId = businessId;
	}


	public Parts() {
		super();
	}


	public Parts(Business businessId, String partNum, int qty,
			String make, String desc, String appli, String specf) {
		
		this.businessId=businessId;
		
		this.prtnum=partNum;
		this.qty=qty;
		this.make=make;
		this.description=desc;
		this.application=appli;
		this.specification=specf;
	}


	public Parts(int partid, int enqid,Business businessId, String partNum, int qty,
			String make, String desc, String appli, String specf) {
		this.partid=partid;
		this.businessId=businessId;
		this.enqid=enqid;
		this.prtnum=partNum;
		this.qty=qty;
		this.make=make;
		this.description=desc;
		this.application=appli;
		this.specification=specf;
	}

	

	public Parts( int enqid,Business businessId, String partNum, int qty,
			String make, String desc, String appli, String specf) {
		this.businessId=businessId;
		this.enqid=enqid;
		this.prtnum=partNum;
		this.qty=qty;
		this.make=make;
		this.description=desc;
		this.application=appli;
		this.specification=specf;
	}


	public Parts(int partId, int quantity) {
		this.partid=partId;
		this.qty=quantity;
	}


	public int getPartid() {
		return this.partid;
	}

	public void setPartid(int partid) {
		this.partid = partid;
	}

	


	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getPrtnum() {
		return this.prtnum;
	}

	public void setPrtnum(String prtnum) {
		this.prtnum = prtnum;
	}

	public int getQty() {
		return this.qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}



	public String getApplication() {
		return this.application;
	}

	public void setApplication(String application) {
		this.application = application;
	}

	public String getMake() {
		return this.make;
	}

	public void setMake(String make) {
		this.make = make;
	}





	public int getEnqid() {
		return enqid;
	}


	public void setEnqid(int enqid) {
		this.enqid = enqid;
	}


	public String getSpecification() {
		return specification;
	}


	public void setSpecification(String specification) {
		this.specification = specification;
	}

}
